package org.exhaust.barbecue.test.action;

import org.exhaust.barbecue.ActionContext;
import org.exhaust.barbecue.action.AbstractPrepareAction;
import org.exhaust.barbecue.test.model.AddUserRequest;
import org.exhaust.barbecue.test.model.AddUserResponse;
import org.exhaust.barbecue.test.util.Context;
import org.springframework.stereotype.Component;

import java.util.UUID;

@Component("AddUserPrepareAction")
public class AddUserPrepareAction extends AbstractPrepareAction<AddUserRequest, AddUserResponse> {
    @Override
    protected void prepare(AddUserRequest request, ActionContext context) {
        String userId = UUID.randomUUID().toString();
        context.putParam(Context.UID, userId);
    }
}
